﻿using System;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.Collections.Generic;

using Caliburn.Micro.BikeWizard.Data;
using Caliburn.Micro.BikeWizard.Utils;

namespace Caliburn.Micro.BikeWizard.Views
{
    public class BikeSummaryViewModel : Screen
    {
        #region Private Members
        private BikeOrder bikeOrder { get; set; }
        #endregion

        #region Public Properties
        public string BikeType
        {
            get { return bikeOrder.BikeType.DisplayName; }
        }

        public string FrameSize
        {
            get { return bikeOrder.FrameSize.DisplayName; }
        }

        public string PartsGroup
        {
            get { return this.bikeOrder.PartsGroup.DisplayName; }
        }

        public string Extras
        {
            get
            {
                string extras = CollectionHelper.ToString(this.bikeOrder.Extras);
                return String.IsNullOrEmpty(extras) ? "No extras selected" : extras;
            }
        }
        #endregion

        #region Constructors
        public BikeSummaryViewModel(BikeOrder bikeOrder)
        {
            this.bikeOrder = bikeOrder;
            this.DisplayName = "Confirm";
        }
        #endregion

        #region Screen Overrides
        protected override void OnActivate()
        {
            Refresh();
        }
        #endregion
    }
}
